//
//  LcLocationCenter.h
//  18Birdies
//
//  Created by Lc on 15/5/10.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>

#import "LcSingleton.h"

typedef void (^RequestLocationAuthHandle)(BOOL granted);

@protocol LcLocationCenterDelegate<NSObject>
@required
- (BOOL)updatingLocation;
- (BOOL)updatingHeading;
- (BOOL)useHighAccuracyMode;
@optional
- (void)onLocationChanged:(CLLocation*)location;
- (void)onHeadingChanged:(CLHeading*)heading;
- (void)onLocationAuthorizedChanged:(BOOL)authorized;
@end

@interface LcLocationCenter : LcSingleton

@property(nonatomic, assign, readonly) BOOL authorized;

- (BOOL)authorizationNotDetermined;
- (BOOL)authorized;
- (void)requestAuthorization:(RequestLocationAuthHandle)requestHandle;
- (BOOL)locationEnabled;

- (CLLocation*)lastKnownLocation;
- (CLHeading*)lastKnownHeading;

- (void)pauseIfStarted;
- (void)resumeIfPaused;

@end
